﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

#if UNITY_EDITOR

using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities.Editor;

#endif

// Attribute used by the NotOneAttributeDrawer
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class ActionInspectorButtonAttribute : Attribute
{
    public ActionBaseData entry;
}

#if UNITY_EDITOR

// Place the drawer script file in an Editor folder.
// Remember to add the OdinDrawer to your custom drawer classes, or it will not be found by Odin.
[OdinDrawer]
public class ActionInspectorButtonDrawer : OdinAttributeDrawer<ActionInspectorButtonAttribute, ActionBaseData>
{
    protected override void DrawPropertyLayout(IPropertyValueEntry<ActionBaseData> entry, ActionInspectorButtonAttribute attribute, GUIContent label)
    {
        SirenixEditorGUI.BeginBox();
        GUILayout.Space(15);
        if (GUILayout.Button("SaveActionBaseData"))
        {
            entry.SmartValue.SaveData();
        }
        GUILayout.Space(15);
        SirenixEditorGUI.EndBox();
        // Continue the drawer chain. 继续原字段的绘制
        //this.CallNextDrawer(entry, label);
    }
}
#endif

